<template>
	<view class="content">
		<common-head title="你好世界"></common-head>
		 <button class="btn" @tap="enterDetail(100)">跳转到详情</button>
		 <!-- #ifdef H5-->
		 <button>这个按钮只在h5下显示</button>
	
		 <!-- #endif -->
			 {{ msg }}
	</view>
</template>

<script>
	export default {
		data() {
			return {
				arr: [1,2,3,4],
				// #ifdef H5
				msg: '数据只在 h5下运行'
				// #endif 
			}
		},
		onLoad() {
			console.log(this.$http);
		},
		onPullDownRefresh() {
		  console.log('页面下拉了');
		},
		methods: {
			changeMsg(n){
				console.log(n);
				uni.showToast({
					title:'哈哈哈'
				})
			},
			enterDetail(id) {
				uni.navigateTo({
					url: `/pages/detail/detail?id=${id}`
				})
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
	/* #ifdef H5 */
	.btn{
		background-color: red;
		width: 300px;
		height: 300px;
	}
	/* #endif */
</style>
